<%@page import="java.io.PrintWriter"%>
<%@page import="com.mysql.jdbc.StringUtils"%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ page import="com.zhuozhengsoft.ZSOfficeX.*, java.awt.*, com.hnjowe.util.*, com.union.core.doc.model.*"%>
<%@ page import="com.union.core.doc.service.*"%>
<jsp:useBean id="ZSOfficeCtrl" scope="page" class="com.zhuozhengsoft.ZSOfficeX.ZSOfficeCtrl"></jsp:useBean>
<%request.setCharacterEncoding("UTF-8");%>
<%
String docid = request.getParameter("docid");
OfficialDoc officialDoc = ComUtil.getOfficialDocService().query(Long.parseLong(docid));

String realOpenFileName = officialDoc.getDoc_file_path();
String showTitle = officialDoc.getTitle();

// 设置ZSOFFICE服务页面
ZSOfficeCtrl.ServerURL = "/zsserver.do";
ZSOfficeCtrl.CanCopy = false;
ZSOfficeCtrl.Toolbars = false;

// 设置界面样式
ZSOfficeCtrl.MainStyle = 2;
ZSOfficeCtrl.Caption = showTitle;
ZSOfficeCtrl.BorderStyle = 0;

//设置保存文档的服务器页面
ZSOfficeCtrl.SaveDocURL = "";

WordResponse wr = new WordResponse();
wr.DisableWindowRightClick = true;
ZSOfficeCtrl.assign(wr);
// 打开文档
ZSOfficeCtrl.webOpen(realOpenFileName, 2, "somebody", "Word.Document");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="/style/style.css" />
</head>
<body>
<!--************** ZSOffice客户端代码开始 ************************-->
<SCRIPT language="JavaScript" event="OnInit()" for="ZSOfficeCtrl">
    // 控件打开文档前触发，用来初始化界面样式
</SCRIPT>
<SCRIPT language="JavaScript" event="OnDocumentOpened(str, obj)" for="ZSOfficeCtrl">
    // 控件打开文档后立即触发，添加自定义菜单，自定义工具栏，禁止打印，禁止另存，禁止保存等等
    ZSOfficeCtrl.CanCopy = false;
    ZSOfficeCtrl.EnableFileCommand(0) = false;//禁止新建
    ZSOfficeCtrl.EnableFileCommand(1) = false;//禁止打开
    ZSOfficeCtrl.EnableFileCommand(3) = false;//禁止保存
    ZSOfficeCtrl.EnableFileCommand(4) = false;//禁止另存为
	ZSOfficeCtrl.CanCopy = false;
       
       
</SCRIPT>
<SCRIPT language="JavaScript" event="OnDocumentClosed()" for="ZSOfficeCtrl">
</SCRIPT>
<SCRIPT language="JavaScript" event="OnUserMenuClick(index, caption)" for="ZSOfficeCtrl">
    // 添加您的自定义菜单项事件响应
</SCRIPT>
<SCRIPT language="JavaScript" event="OnCustomToolBarClick(index, caption)" for="ZSOfficeCtrl">
    // 添加您的自定义工具栏按钮事件响应
</SCRIPT> 
<!-- 客户端控件引用 -->
<%=ZSOfficeCtrl.getDocumentView("ZSOfficeCtrl", request)%> 
<!--************** ZSOffice客户端代码结束 ************************-->
</body>
</html>